/*
 *    Copyright (c) 2019- 2020  autoai All Rights Reserved
 *    FileName: JacksonUtils.java
 *    ProjectName: autoai-group
 *    @Date:2020/1/15 下午2:38
 *    @Author:guoyb
 *    @version: 1.0
 */

package com.xncoding.pos.init;

import com.xncoding.pos.config.ProjectConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * JacksonUtils工具类
 *
 * @Author guoyb
 * @Date 2020/1/15  14:38
 */
@Slf4j
@Component
public class MyUtils {

    //静态属性
    private static String mess;


    /**
     * 保证外界无法直接实例化
     */
    private MyUtils() {

    }

    public static void testMethod() {
        log.info("testMethod-----mess------{}", mess);
    }

    @Autowired
    public ProjectConfig config;

    @PostConstruct
    public void init() {
        log.info("JacksonUtils初始化:静态属性赋值-----{}", config.toString());
        MyUtils.mess = this.config.getName();
    }

}
